import request from '@/utils/request'

// 查询内容分类列表
export function listClassify(query) {
  return request({
    url: '/article/classify/list',
    method: 'get',
    params: query
  })
}

// 查询内容分类详细
export function getClassify(id) {
  return request({
    url: '/article/classify/' + id,
    method: 'get'
  })
}

// 新增内容分类
export function addClassify(data) {
  return request({
    url: '/article/classify',
    method: 'post',
    data: data
  })
}

// 修改内容分类
export function updateClassify(data) {
  return request({
    url: '/article/classify',
    method: 'put',
    data: data
  })
}

// 删除内容分类
export function delClassify(id) {
  return request({
    url: '/article/classify/' + id,
    method: 'delete'
  })
}


// 生成
// export function startGen(id) {
//   return request({
//     url: '/article/classify/startGen/' + id,
//     method: 'get'
//   })
// }

// 执行生成
export function startGen(id,genPs) {
  genPs.ids = id;
  console.log(genPs)
  return request({
    url: '/article/classify/startGen',
    method: 'post',
    data: genPs
  })

}

// 查询分类项列表
export function classItemSelect(query) {
  return request({
    url: '/article/classItem/list',
    method: 'get',
    params: query
  })
}
// 生成当前条件下所有文章
export function startGenAll(query,genPs) {
  query.genPs = genPs;
  console.log(query)
  return request({
    url: '/article/classify/tartGenAll/',
    method: 'post',
    data: query
  })
}


// 执行生成
export function checkTxtClassifyName(genPs) {
  console.log(genPs)
  return request({
    url: '/article/classify/checkTxtClassifyName',
    method: 'post',
    data: genPs
  })

}
